﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for ExtensionMethods
/// </summary>
public static class ExtensionMethods
{
    public static DateTime toDateTimeWithoutError(this object value)
    {
        DateTime dt = DateTime.MinValue;
        try
        {
            dt = System.Convert.ToDateTime(value);
        }
        catch
        {
        }
        return dt;
    }

    public static string ToTitleCase(this String value)
    {
        string ret = value;
        try
        {
            ret = System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(value.ToLower());
        }
        catch
        {
        }
        return ret;
    }
}